var e = require;
var t = module;
var n = exports;
Object.defineProperty(n, "__esModule", {value: !0}), (n.shuffleCoin = void 0);
var b = e("events"),
    _ = e("player-coin"),
    w = e("player-info"),
    e =
        ((o.prototype.shuffleCoinByCellNew = function (e, t) {
            for (
                var n = w.playerInfo.getUnlockCell(),
                    o = Math.min(e.length, n),
                    i = [],
                    r = [],
                    a = new Map(),
                    s = _.playerCoin.getCoinMaxNumber(),
                    c = 0;
                c < o;
                c++
            ) {
                (f = e[c]).hideQuestionMarks();
                for (var l = f.getCoinItemCount(), u = f.getMoveCoinAll(l), p = 0; p < u.length; p++) {
                    var h = u[p];
                    h.setIsUnknown(!1);
                    var d = h.getNum();
                    d < s && (s = h.getNum()),
                        a.has(d) ? a.set(d, a.get(d) + 1) : (r.push(d), a.set(d, 1)),
                        a.get(d) <= 10
                            ? i.push(h)
                            : ((h.node.active = !1),
                              b.operEvent.emit({action: b.default.recoveryCoin, data: {coin: h}}));
                }
            }
            for (r.sort(), r.length > o && r.splice(0, r.length - o), a.clear(), c = 0; c < r.length; c++) {
                var f = r[c];
                a.set(f, c);
            }
            for (var m = new Map(), c = 0; c < i.length; c++) {
                var y,
                    g = i[c],
                    v = g.getNum();
                a.has(v)
                    ? ((y = a.get(v)), m.has(y) ? ((v = m.get(y)).push(g), m.set(y, v)) : m.set(y, [g]))
                    : ((g.node.active = !1), b.operEvent.emit({action: b.default.recoveryCoin, data: {coin: g}}));
            }
            t(m);
        }),
        o);
function o() {}
n.shuffleCoin = new e();
